/**************************************************************************************** Import */
import _ from 'lodash';
import React, {Component} from 'react';
import {View} from 'react-native';
import { Icon,  List, Button, InputItem, Tabs } from 'antd-mobile-rn';
import { CAround, CBetween, CCenter, CColumn, CFloat, CHand, CItemX, CItemY, CLine, CLoad, CRow, CWrap, CBone, CIcon, CImage, CSvg, CText, CFull, CScroll, CFooter, CHeader, CPage, CButton, CLabel, PTabbar, PHeader } from '../../../library/comp';
import { Dialog, Http, PageBase } from '../../../library/func';
import Design from '../../../design';
import Config from '../../../config';

/**************************************************************************************** Pageload */

/**************************************************************************************** Cacheload */

/**************************************************************************************** Preload */

/**************************************************************************************** Get */

/**************************************************************************************** Post */

/**************************************************************************************** Page */
 export default class RepairList extends PageBase {
    constructor(props) {
        super(props);
        this.state = {
            data:{

            }
        };
    }

    /************************************************************************************ Life */
    /**
     * didMount
     */
    componentDidMount(){

        // 页面加载
        // this.pageload();

        // console.log('被执行');

        Http.get({
            url: 'page/repair/list.php',
            data: {},
            success: (data)=> {
                console.log('success',data)
            },
            pipe: Config.pipe.action.default
        })
        
    }

    /************************************************************************************ Render */
    render(){
        return(
            <CPage>

                <CScroll bg='#efeff4' my='96'>

                    <CRow onPress={e=>this.nav.navigate('Service_Report_Detail')}>
                        <CItemY bg="#fff" mt="20" >
                            <CBetween py='20' px="40" style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CLine>
                                    <CText size='26' color='#333'>报修单号：</CText>
                                    <CText size='26' color='#333'>89898989</CText>
                                </CLine>
                                <CText size='26' color='#999'>公共区</CText>
                            </CBetween>

                            <CLine py='20' px="40" y='top' style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CText size='26' color='#333'>报修描述：</CText>
                                <CText size='24' f="1" color="#666">五号楼右边电梯坏了，不能上下人，有人困在了里面，请及时来修复一下！！</CText>
                            </CLine>

                            <CBetween w="750" py="20" px='40'>
                                <CHand x="left">
                                    <CText size='24' color="#999">2018.12.2</CText>
                                </CHand>
                                <CItemX x="right" y='center'>
                                    <CText size='24' color="#f60">处理中</CText>
                                    <CIcon icon={ Design.icon["make-right"] } w='24' h='24' ml='8' color='#f60'></CIcon>
                                </CItemX>
                            </CBetween>
                        </CItemY>
                    </CRow>

                    <CRow onPress={e=>this.nav.navigate('Service_Report_WaitDetail')}>
                        <CItemY bg="#fff" mt="20">
                            <CBetween py='20' px="40" style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CLine>
                                    <CText size='26' color='#333'>报修单号：</CText>
                                    <CText size='26' color='#333'>89898989</CText>
                                </CLine>
                                <CText size='26' color='#999'>公共区</CText>
                            </CBetween>

                            <CLine py='20' px="40" y='top' style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CText size='26' color='#333'>报修描述：</CText>
                                <CText size='24' f="1" color="#666">五号楼右边电梯坏了，不能上下人，有人困在了里面，请及时来修复一下！！</CText>
                            </CLine>

                            <CBetween w="750" py="20" px='40'>
                                <CHand x="left">
                                    <CText size='24' color="#999">2018.12.2</CText>
                                </CHand>
                                <CItemX x="right" y='center'>
                                    <CText size='24' color="#d81e06">待处理</CText>
                                    <CIcon icon={ Design.icon["make-right"] } w='24' h='24' ml='8' color='#d81e06'></CIcon>
                                </CItemX>
                            </CBetween>
                        </CItemY>
                    </CRow>

                    <CRow onPress={e=>this.nav.navigate('Service_Report_FinishDetail')}>
                        <CItemY bg="#fff" mt="20">
                            <CBetween py='20' px="40" style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CLine>
                                    <CText size='26' color='#333'>报修单号：</CText>
                                    <CText size='26' color='#333'>89898989</CText>
                                </CLine>
                                <CText size='26' color='#999'>公共区</CText>
                            </CBetween>

                            <CLine py='20' px="40" y='top' style={{ borderBottomColor:"#efeff4", borderBottomWidth:1 }}>
                                <CText size='26' color='#333'>报修描述：</CText>
                                <CText size='24' f="1" color="#666">五号楼右边电梯坏了，不能上下人，有人困在了里面，请及时来修复一下！！</CText>
                            </CLine>

                            <CBetween w="750" py="20" px='40'>
                                <CHand x="left">
                                    <CText size='24' color="#999">2018.12.2</CText>
                                </CHand>
                                <CItemX x="right" y='center'>
                                    <CText size='24' color="#0C6">已完成</CText>
                                    <CIcon icon={ Design.icon["make-right"] } w='24' h='24' ml='8' color='#0C6'></CIcon>
                                </CItemX>
                            </CBetween>
                        </CItemY>
                    </CRow>

                </CScroll>

                {/* header */}
				<PHeader nav={this.nav}>故障报修</PHeader>

                {/* 底部 */}
                <CFooter h='96' y='center' bg='#fff' style={{ borderTopColor:"#eee", borderTopWidth:1 }}>
                    <CHand w="750" h="96" bg="#00CC66" x="center" y="center">
                        <CButton  {...Design.global.commonButton} ra='0' size='34' onPress={()=> {
                            this.nav.navigate('Service_Report_Add');
                        }}>我要报修</CButton>
                    </CHand>
                </CFooter>
                {/* 底部 */}

            </CPage>
        )
    }
}
